#ifndef _GUIBUTTON_H_INCLUDE_
#define _GUIBUTTON_H_INCLUDE_

#include "guibasenode.h"

class GuiButton : public GuiBaseNode
{
public:
    GuiButton();
    GuiButton(int id,wxString nodename);
    ~GuiButton();

    /// 检测当前按钮是否被选中
    inline bool isSelected(void) { return mSelected; }
    /// 设置当前按钮是否选中
    inline void setSelected(bool selected)
    {
        mSelected = selected;
    }
    /// 设置当前显示颜色
    inline void setShowColor(wxColour color) { mShowColour = color; }

    /// 设置结点显示颜色
    virtual void setColor(wxColour normalcol,wxColour overcol,wxColour clickcol);

    /// 工作区域改变
    virtual void changeWorkingRect(wxRect workingrect);
    /// 更新
    virtual void update(void);
    /// 绘制
    virtual void draw(maindrawscene *painter);
    /// 处理鼠标事件
    virtual bool OnMMouseEvent(wxMouseEvent event);
    /// 重置结点状态
    virtual void reset(void);

private:
    /// 初始按钮颜色
    void initBtnColor(void);

private:
    wxColour mShowColour;              /**< 按钮显示颜色 */
    bool mSelected;                    /**< 是否被选中 */
};

#endif // GUIBUTTON_H
